//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace Microsoft.Research.ScientificWorkflow.ManagementStudioControls.RegistryManagerModule
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Shapes;
    using Microsoft.Research.ScientificWorkflow.ManagementStudioModels;


	/// <summary>
	/// Interaction logic for SelectUser.xaml
	/// </summary>
	public partial class SelectGroup : Window
	{
        public SelectGroup()
		{
			this.InitializeComponent();
            this.brdrHeader.MouseLeftButtonDown += (sender, e) => { this.DragMove(); };
		}

        private void OnGroupChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
        {
            SelectGroupPresenter presenter = this.DataContext as SelectGroupPresenter;
            if (presenter != null)
            {
                TreeView groupList = sender as TreeView;
                if (groupList != null)
                {
                    presenter.SelectGroupModel = groupList.SelectedItem as SelectGroupModel;
                }
            }
        }
	}
}